package paritclecontainer2d;

import java.awt.Color;

public class RainbowToggleEmiter extends ToggleEmiter {

	private static final int pWidth = 15;
	private static final int pHeight = 1;
	
	private static final int TTL = Particle.TTL_CAP;
	
	private Particle yellowParticle;
	private Particle redParticle;
	private Particle orangeParticle;
	
	public RainbowToggleEmiter(int decay, int speed) {
		super(decay, speed);
		
		yellowParticle = new  ColoredParticle(Color.YELLOW, TTL, pWidth,pHeight,true);
		orangeParticle = new  ColoredParticle(Color.ORANGE, TTL, pWidth,pHeight,true);
		redParticle = new  ColoredParticle(Color.RED, TTL, pWidth,pHeight,true);
		

	}

	@Override
	protected void createParticle() {
	
		spawnParticle(yellowParticle, 	1, 	emiterX, emiterY-2);
		spawnParticle(orangeParticle, 	1, 	emiterX, emiterY-1);
		spawnParticle(redParticle, 		1,	emiterX, emiterY);
		
		spawnParticle(redParticle, 		1,	emiterX, emiterY+1);
		spawnParticle(orangeParticle, 	1, 	emiterX, emiterY+2);
		spawnParticle(yellowParticle, 	1, 	emiterX, emiterY+3);
		
	}

	
	
}
